package com.ease.platform.model.type;

import com.ease.common.enums.EnumUtil;
import com.ease.common.enums.OptionalEnum;

public enum PermissionType implements OptionalEnum {

	// 对应其它任何action
	Other((short) 0, "Other"),
	// 查询 区域权限
	ViewLocation((short) 1, "ViewLocation"),
	// 管理区域权限
	OperateLocation((short) 2, "OperateLocation"),
	// 这界面相关比较特殊，显示与否TM_COOLMENU.ID
	MainMenu((short) 3, "MainMenu"),
	// 针对右键菜单和toolbutton 对应的 TM_ACTION上的ID
	Action((short) 4, "Action"),
	// 这界面相关比较特殊，显示与否
	Explorer((short) 5, "Explorer"),
	// 这界面相关比较特殊，显示与否
	PerspectiveView((short) 6, "PerspectiveView");

	private short value;

	private String text;

	private PermissionType(short value, String text) {
		this.value = value;
		this.text = text;
	}

	public static PermissionType get(short value) {
		return EnumUtil.get(PermissionType.class, value);
	}

	public static PermissionType get(String name) {
		return EnumUtil.get(PermissionType.class, name);
	}

	public String getText() {
		return this.text;
	}

	public String getName() {
		return name();
	}

	public short getValue() {
		return value;
	}
}
